import React, {Component} from 'react';
import {
    StyleSheet,
    View,
    Image
} from 'react-native';
import Main from './Main/Main';
let dimension = require('Dimensions');
let width = dimension.get('window').width;
export default class First extends Component {
    constructor(props) {
        super(props);
        this.state = {};
    }

    componentDidMount() {
        this.timer = setTimeout(() => {
            let {navigator} = this.props;
            if (navigator) {
                navigator.replace({
                    name: 'Main',
                    component: Main,
                })
            }
        }, 1000)
    }

    componentWillUnmount() {
        this.timer && clearInterval(this.timer);
    }


    render() {
        let pic = {uri: 'http://bmob-cdn-9229.b0.upaiyun.com/2017/02/22/ac57e5b1403aadc4808de77b47b638a5.jpg'}
        return (
            <View style={styles.container}>
                <Image source={pic} style={styles.imageStyleImg}/>

                <Image source={require('../img/icon.png')} style={styles.imageStylePag}/>
            </View>
        );
    }
}
const styles = StyleSheet.create({
    container: {
        flex: 1,
    },
    imageStyleImg: {
        flex: 6,
        width: width
    },
    imageStylePag: {
        flex: 1,
        width: width
    }
});
